<?php

/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2018/3/26
 * Time: 19:16
 */
class Foo {
	// 自 5.3.0 起
	public $bar = <<<'EOT'
bar
EOT;
}

echo ( new Foo() )->bar . PHP_EOL;//bar
$str   = "Foo";
$clazz = new $str;
//bar
echo $clazz->bar . PHP_EOL;
$clazz->{'say'} = "what?\n";
echo $clazz->say;